Time Limited Trial License Model

Developing Applications Using The SoftwareShield System > Creating Licensing Solutions > Available License Models > Time Limited Trial License Model (Days)

## Time Limited Trial License Model (Days)

This model allows you to deliver a time limited trial version of your software that expires at some arbitrary point in time after the user first runs the software. When expired, your software can either stop functioning completely or change to some other model. This is the same as Time Limited Trial License Model (Hours/Mins) but the expire period is expressed in days.

For detailed information about expiration types and features see Expiring Licenses in the Feature Guide.

### Overview - How to Integrate the Time Limited Trial License Model Into Your Application

1. The first step is simply defining a license that expires using an Expire Period. Note that any of the three types of expiration can be individually used or used in combination with each other. If used in combination your application is expired as soon as any one of the types of expiration takes effect. This section deals with "expire periods". The expire period is a fixed amount of time that begins to elapse immediately after your application is run for the first time. After this period is over, your application is expired. This is the most common type of expiring license and should be used to create most "trial versions".

2. The next step is to ensure that your license has the necessary Authorization Definitions built into it. You decide which definitions to include based on how you want your licenses expiration to behave. There are several Authorization Definitions which can manipulate expiring licenses. You may need a "Release All Expiration" definition, a "Reset Expire Period" definition, a "Change Expire Period Duration" definition, an "Add Expire Period", "Composite" definitions (which allow you to use a combination of definitions simultaneously), or all of them - depending on what kinds of expiration your build into your license and how you want it to behave. Please see Authorization Definitions for detailed information on the Authorization Definition features.

3. Once you are satisfied with your license, compile a distributed copy of it. The distributed copy is encrypted and compressed and only contains absolutely necessary information for the enforcement of your license. Place a copy of this distributed license in your applications directory. If you have decided to use steganographic alias files, make sure that they are also in the application directory. Have a look at the programming notes file that the SoftwareShield License Manager creates for your specific license. This will make your programming a little easier by supplying you with the code you will need to invoke the start up event. Please see Deploying the License for Your Application for more detailed information about deploying your license.

4. Next, in your programs startup event (main form load etc.) create an instance of the ClientProtector object (SSCProtector) and immediately call its StartUp function. You will have to pass specific parameters such as the license name, main license file password, and the finger print options code - but this code will have been already written for your convenience when you compiled your license - just look in the programming notes file created by the SoftwareShield License Manager. Have a look at the exact details of the StartUp function for more information on making this call.

5. Now, depending on the return value from the ClientProtector StartUp call (in the return_code reference parameter), you can determine if the license is expired or not. If you wish to give the user updated feedback about how much of his trial period remains, you can make calls to the ClientProtector to get detailed information about the expiration. See ClientProtector Reference for more detail. At this point, have your application launch the program in "trial mode" if it has not yet expired. Shut down the program if it has expired after prompting the user to buy and possibly giving them the opportunity to enter an Activation Code if they already have. Run the program in full release mode if the license has been unlocked completely. For information on how to interpret the return_code parameter when deploying a trial version of your application, have a look at RETURNCODES.